
public class Test {
    public static void main(String[] args) {
        System.out.println("Test-Hello");
        //进制
        byte b1=0b01100001;
        byte b2=0141;
        byte b3=97;
        byte b4=0x61;
        System.out.println("b1:="+b1);
        System.out.println("b2:="+b2);
        System.out.println("b3:="+b3);
        System.out.println("b4:="+b4);
        //数据类型转换
        //int类型值
        long num=10;
        System.out.println("num:"+num);
        //
        double price =8.0F;
        System.out.println("price:"+price);
        //
        /*int length=10.5;
        System.out.println("length:"+length);     报错！！！！不兼容的类型: 从double转换到int可能会有损失
        
        */

        //byte short char类型在做算术运算时会自动提升为int类型，然后再参与运算
        byte b=10;
        short s=5;
        /*short sum=b+s;
        System.out.println("sum");        报错！！！ 不兼容的类型: 从int转换到short可能会有损失*/
        int sum=b+s;
        System.out.println("sum:"+sum);

        byte byte1=10;
        short short1=5;
        double double1=1.0;
        double t=(byte1-5)*short1+double1;
        System.out.println("t:"+t);
      
        //强制型转换
        float float1=(float)3.14;
        float float2=(float)((byte1-5)*short1+double1);
        System.out.println("float1:"+float1);
        System.out.println("float2:"+float2);
       
        //指出下面程序有问题的地方
        byte b7=3;
        byte b8=4;
        byte b9=3+4;
        //byte b10=b7+b8;
        //byte b11=b7+4;
        System.out.println("b7:"+b7);
        System.out.println("b8:"+b8);
        System.out.println("b9:"+b9);
       //System.out.println("b10:"+b10);
       // System.out.println("b11:"+b10);
    
        



    }
}
